$(document).ready(function() {
	arrayAno = getUrlParameters()["ano"];
	arrayAno = arrayAno.split("-");
	ticks1 = "[\"" + arrayAno[0] + "\"";
	for (i = 1; i < arrayAno.length; i = i + 1) {
		ticks1 = ticks1 + ",\"" + arrayAno[i] + "\"";

	}
	ticks1 = ticks1 + "]";
	$("#teste").html("<p><center>Resumo de compra por mês</center></p>");
	$.jqplot.config.enablePlugins = true;
	var s1 = $.parseJSON(getUrlParameters()["soma"]);// [2, 6, 7,
														// 60];
	var ticks = $.parseJSON(ticks1);// ['Junho', 'Junho', 'Abril',
									// 'Abril'];

	plot1 = $.jqplot('chart3', [ s1 ], {
		// Only animate if we're not using excanvas (not in IE 7 or IE
		// 8)..
		animate : !$.jqplot.use_excanvas,
		seriesDefaults : {
			renderer : $.jqplot.BarRenderer,
			pointLabels : {
				show : true
			}
		},
		axes : {
			xaxis : {
				renderer : $.jqplot.CategoryAxisRenderer,
				ticks : ticks
			}
		},
		highlighter : {
			show : false
		}
	});

	$('#chart1').bind('jqplotDataClick',
			function(ev, seriesIndex, pointIndex, data) {
				// $('#info3').html('series: '+seriesIndex+', point:
				// '+pointIndex+', data: '+data);
			});
});

function getUrlParameters() {
	var map = {};
	var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,
			function(m, key, value) {
				map[key] = value;
			});
	return map;
}